package com.apes.framework.plugin.soe.core.service;

import com.apes.framework.plugin.soe.metadata.*;

import java.util.List;

/**
 * 功能：运行时服务
 *
 * @author xul
 * @create 2018-09-25 15:01
 */
public interface RuntimeService {

    /**
     * 创建场景实例
     **/
    SceneInstance startSceneInstanceByKey(String sceneId);


    /**
     * 创建场景实例
     **/
    SceneInstance startSceneInstance(Scene scene);

    /**
     * 标记场景实例已完成
     **/
    void finishedSceneInstance(SceneInstance sceneInstance);

    /**
     * 挂起场景实例
     **/
    void suspendSceneInstanceById(String sceneInstanceId);

    /**
     * 激活场景实例
     **/
    void activateSceneInstanceById(String sceneInstanceId);

    /**
     * 查的场景实例
     **/
    SceneInstance findSceneInstance(String sceneInstanceId);

    /**
     * 查的场景实例
     **/
    SceneInstance findSceneInstance(String sceneId, String businessTypeId, String businessKey);

    /**
     * 查的场景实例
     **/
    SceneInstance findSceneInstance(Scene scene, BusinessType businessType, String businessKey);

    /**
     * 查的场景实例流
     **/
    List<SceneInstanceFlow> findSceneInstanceFlow(String sceneInstanceId, String sceneFlowId);

    /**
     * 查的场景实例流
     **/
    List<SceneInstanceFlow> findSceneInstanceFlow(SceneInstance sceneInstance, SceneFlow sceneFlow);

    /**
     * 创建场景实例流
     **/
    SceneInstanceFlow createSceneInstanceFlow(SceneInstance sceneInstance, SceneFlow sceneFlow);

    /**
     * 创建场景实例角色
     **/
    SceneInstanceRole createSceneInstanceRole(SceneInstance sceneInstance, String businessTypeId, String businessKey);

    /**
     * 创建场景实例角色
     **/
    SceneInstanceRole createSceneInstanceRole(SceneInstance sceneInstance, BusinessType businessType, String businessKey);
}
